package com.ssm.web.config;

import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@ServletComponentScan("com.ssm.web.config.filter")
public class SpringMvcConfig implements WebMvcConfigurer {
    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        // https://fangshixiang.blog.csdn.net/article/details/89810020
        // 不让 "/hello.aaaa"、"/hello.aaaa/“ 或 "/hello/" 能匹配上 /hello
        // 关闭后缀名匹配，关闭最后一个 / 匹配
        configurer.setUseSuffixPatternMatch(true);
        configurer.setUseTrailingSlashMatch(true);
    }
}
